<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		
		<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
	</head>
	<body>
		
		<div id="app">
			
			学生成绩:<input type="text" v-model="score" /><br />
			{{score}}<br />
			{{message}}
			{{result}}
		</div>
		
		<script>
			var app = Vue.createApp({
				data(){
					return {
						"message":"Hello World!",
						"score":0,
						"result":""
					}
				},
				methods:{
					judge(){
						this.result="正在运算，请稍后"
						setTimeout(()=>{
						if(this.score>=60)
								{
								this.result="及格"
								}
						 else
						{
							this.result="不及格"
						}},2000);
					}
				},
				watch:{
					score:'judge'
				}
			});
			var vm = app.mount("#app")
		</script>
	</body>
</html>
